# -*- coding: utf-8 -*-

import requests


def get_beian_info(domain):
    url = "http://api.k780.com:88"
    data = {
            "app": "domain.beian",
            "domain": domain,
            "appkey": "10419",
            "sign": "9494b8fc61ec01487bafbe4ee6ceda1a",
            "format": "json"
        }

    r = requests.post(url, data=data)
    rv = r.json()
    if rv["success"] == "0":
        return None
    if not rv["result"]["icpno"]:
        return None

    return rv["result"]

if __name__ == '__main__':
    print get_beian_info("cloverstd.com")
